home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / INTERVIE / DIALOGS.H < prev    next >
C/C++ Source or Header  |  1980-01-05  |  3KB  |  95 lines

  1. /*
  2.  * Copyright (c) 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. /*
  24.  * Various dialog boxes.
  25.  */
  26.  
  27. #ifndef dialogs_h
  28. #define dialogs_h
  29.  
  30. #include <InterViews/dialog.h>
  31.  
  32. class FileBrowser;
  33.  
  34. class BasicDialog : public Dialog {
  35. public:
  36.     BasicDialog();
  37.  
  38.     virtual boolean Accept();
  39. protected:
  40.     void Forward(Event&);
  41.     boolean KeyEquiv(Event&);
  42. };
  43.  
  44. class AcknowledgeDialog : public BasicDialog {
  45. public:
  46.     AcknowledgeDialog(const char* msg, const char* btnLbl = "   OK   ");
  47.  
  48.     virtual void Acknowledge();
  49. };
  50.  
  51. class ConfirmDialog : public BasicDialog {
  52. public:
  53.     ConfirmDialog(const char* msg, const char* confirmLbl = "   OK   ");
  54. };
  55.  
  56. class StringDialog : public BasicDialog {
  57. public:
  58.     StringDialog(
  59.         const char* msg, const char* sample = "",
  60.         const char* confirmLbl = "   OK   "
  61.     );
  62.     StringDialog(
  63.         const char* msg, int width,
  64.         const char* confirmLbl = "   OK   "
  65.     );
  66.  
  67.     const char* String();
  68.     void Select();
  69.     void Select(int);
  70.     void Select(int, int);
  71.     virtual boolean Accept();
  72. private:
  73.     void Init(const char*, const char*, int width = 0);
  74. private:
  75.     class StringEditor* _sedit;
  76. };
  77.  
  78. class FileDialog : public BasicDialog {
  79. public:
  80.     FileDialog(
  81.         const char* msg, const char* dir = "~",
  82.         const char* confirmLbl = "   OK   "
  83.     );
  84.  
  85.     FileBrowser* GetBrowser();
  86. private:
  87.     Interactor* AddScroller(Interactor*);
  88. private:
  89.     FileBrowser* _browser;
  90. };
  91.  
  92. inline FileBrowser* FileDialog::GetBrowser () { return _browser; }
  93.  
  94. #endif
  95.